package com.carbohydrate42.kotlin_compose_demo.api

import com.carbohydrate42.kotlin_compose_demo.config.RetrofitConfig
import com.carbohydrate42.kotlin_compose_demo.dto.base.Result
import com.carbohydrate42.kotlin_compose_demo.dto.bo.FileSearchBo
import com.carbohydrate42.kotlin_compose_demo.dto.vo.FileVo
import okhttp3.MultipartBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST

interface FileApi {
    @POST("file/upload")
    suspend fun upload(@Body file: MultipartBody): Response<Result<FileVo>>

    @POST("file/download")
    suspend fun download(@Body searchBo: FileSearchBo): Response<Result<List<Int>>>

    @POST("file/get")
    suspend fun get(@Body searchBo: FileSearchBo): Response<Result<FileVo>>


    companion object {
        val instance: FileApi by lazy { RetrofitConfig.instance.create(FileApi::class.java) }
    }
}